package com.ra.landlord;

import com.googlecode.cswish.annotation.Rest;
import com.googlecode.cswish.struts.spring.GenericService;
import com.ra.system.Version;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.googlecode.cswish.annotation.Rest;
import com.googlecode.cswish.struts.spring.GenericService;
import com.ra.system.Version;

/**
 * @author colin
 * @date 2014年9月30日
 */
@Service
public class FeeAdditionService {

	@Resource
	private GenericService genericService;

	@Resource
	private LandlordUserService landlordUserService;

	@Resource
	private LandlordUserService TenantUserService;

	@Resource
	private FeeService feeService;

	@Resource
	private MeterService meterService;

	@Rest(type = "search")
	public List<FeeAddition> searchFeeAddition(FeeAddition feeAddition) {
		LandlordUser landlordUser = this.landlordUserService.getLoginUser();
		if (landlordUser != null) {
			feeAddition.setLandlordUser(landlordUser.getOwnerUser());
			feeAddition.setStatus(Version.STATUS_VALID);
			List<FeeAddition> agreements = this.genericService.searchAll(feeAddition).getData();
			return agreements;
		} else {
			return new ArrayList<>();
		}
	}
}